package com.alibaba.controller;

import com.alibaba.annotation.SystemLog;
import com.alibaba.common.ResponseResult;
import com.alibaba.define.service.UploadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author : hanyang
 * @date : 2023-11-05 15:28
 **/
@RestController
@Slf4j
public class UploadController {

    @Resource
    UploadService uploadService;

    @PostMapping("/upload")
    @SystemLog(businessName = "头像上传")
    public ResponseResult<String> uploadImg(MultipartFile img) {
        log.info("UploadController#uploadImg() ...");
        return uploadService.uploadImg(img);
    }
}
